Make unicsv a little more QString ready internally.
authorrobertlipe <robertlipe@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Mon, 23 Sep 2013 02:40:24 +0000 (02:40 +0000)
committerrobertlipe <robertlipe@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Mon, 23 Sep 2013 02:40:24 +0000 (02:40 +0000)
git-svn-id: http://gpsbabel.googlecode.com/svn/trunk@4624 f51c46e8-681c-474f-0cfe-069cfd0219fb

gpsbabel/unicsv.cc

index 5a9813f4b25a28d35ca56b8766459ff07adb595e..9b14ca8e315f7a08aeefab17192f22bfa54de3d4 100644 (file)
@@ -1293,13 +1293,12 @@ unicsv_print_data_time(const QDateTime& idt)
 static void
 unicsv_waypt_enum_cb(const waypoint* wpt)
 {
-  const char* shortname;
   garmin_fs_t* gmsd;
 
-  shortname = (wpt->shortname) ? CSTRc(wpt->shortname) : "";
+  const QString& shortname = wpt->shortname;
   gmsd = GMSD_FIND(wpt);
 
-  if (*shortname) {
+  if (!shortname.isEmpty()) {
     gb_setbit(&unicsv_outp_flags, fld_shortname);
   }
   if (wpt->altitude != unknown_alt) {
@@ -1308,10 +1307,10 @@ unicsv_waypt_enum_cb(const waypoint* wpt)
   if (!wpt->icon_descr.isNull()) {
     gb_setbit(&unicsv_outp_flags, fld_symbol);
   }
-  if (wpt->description && *wpt->description && (strcmp(shortname, wpt->description) != 0)) {
+  if (wpt->description && *wpt->description && shortname != wpt->description) {
     gb_setbit(&unicsv_outp_flags, fld_description);
   }
-  if (wpt->notes && *wpt->notes && (strcmp(shortname, wpt->notes) != 0)) {
+  if (wpt->notes && *wpt->notes && shortname != wpt->notes) {
     if ((! wpt->description) || (strcmp(wpt->description, wpt->notes) != 0)) {
       gb_setbit(&unicsv_outp_flags, fld_notes);
     }